.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: dialog-fade-in 0.2s ease-out;
  background: rgba(0, 0, 0, 0.2);
  transform: translateZ(0); /* 创建新的层叠上下文，避免受父元素transform影响 */
  padding: 20px;
  box-sizing: border-box;
  min-height: 100vh;
}

@keyframes dialog-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dialog-modal {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25),
              0 8px 24px rgba(0, 0, 0, 0.15);
  max-width: 480px;
  width: 90%;
  padding: 32px;
  animation: dialog-scale-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  position: relative;
  margin: auto;
  transform: translateZ(0); /* 确保独立层叠上下文 */
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes dialog-scale-in {
  from {
    opacity: 0;
    transform: scale(0.8) translateZ(0);
  }
  to {
    opacity: 1;
    transform: scale(1) translateZ(0);
  }
}

.dialog-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, #f0f5ff 0%, #e8f0ff 100%);
  color: #007AFF;
}

.dialog-content {
  text-align: center;
  margin-bottom: 28px;
}

.dialog-title {
  font-size: 20px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0 0 12px 0;
}

.dialog-message {
  font-size: 15px;
  line-height: 1.6;
  color: #666;
  margin: 0 0 24px 0;
}

.dialog-fields {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dialog-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dialog-label {
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dialog-required {
  color: #FF3B30;
}

.dialog-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e5e5e7;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.dialog-input:focus {
  border-color: #007AFF;
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.dialog-input-error {
  border-color: #FF3B30;
}

.dialog-input-error:focus {
  border-color: #FF3B30;
  box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.1);
}

.dialog-input::placeholder {
  color: #999;
}

.dialog-select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e5e5e7;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
  background: #ffffff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.dialog-select:focus {
  border-color: #007AFF;
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.dialog-select-error {
  border-color: #FF3B30;
}

.dialog-select-error:focus {
  border-color: #FF3B30;
  box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.1);
}

.dialog-error {
  font-size: 13px;
  color: #FF3B30;
  margin-top: -4px;
}

.dialog-color-input-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.dialog-color-group {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.dialog-color-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dialog-color-label {
  font-size: 12px;
  color: #666;
  text-align: center;
}

.dialog-color-block-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialog-color-block {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid #e5e5e7;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: block;
}

.dialog-color-block:hover {
  border-color: #007AFF;
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.dialog-color-value {
  font-size: 14px;
  color: #666;
  font-family: 'Courier New', monospace;
  font-weight: 500;
}

.dialog-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.dialog-btn {
  flex: 1;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: inherit;
}

.dialog-btn-cancel {
  background: #f5f5f7;
  color: #1d1d1f;
}

.dialog-btn-cancel:hover {
  background: #e8e8ed;
}

.dialog-btn-cancel:active {
  transform: scale(0.98);
}

.dialog-btn-confirm {
  background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
  color: white;
}

.dialog-btn-confirm:hover {
  background: linear-gradient(135deg, #0051D5 0%, #003CB0 100%);
}

.dialog-btn-confirm:active {
  transform: scale(0.98);
}

/* 响应式 */
@media (max-width: 768px) {
  .dialog-modal {
    max-width: 340px;
    padding: 24px;
  }

  .dialog-icon {
    width: 56px;
    height: 56px;
    font-size: 28px;
    margin-bottom: 20px;
  }

  .dialog-title {
    font-size: 18px;
  }

  .dialog-message {
    font-size: 14px;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-btn {
    width: 100%;
  }
}

